
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
         <meta name="layout" content="adminContas" />
        <g:set var="entityName" value="${message(code: 'usuarioComum.label', default: 'UsuarioComum')}" />
        <title>SPL - Usuarios</title>
    </head>
    <body>
       
        <div class="body">
            <h1><g:message code="Usuarios Cadastrados" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                        	<g:sortableColumn property="userRealName" title="${message(code: 'usuarioComum.userRealName.label', default: 'Nome')}" />
                        	
                            <g:sortableColumn property="username" title="${message(code: 'usuarioComum.username.label', default: 'Login')}" />
                                               
                            <g:sortableColumn property="email" title="${message(code: 'usuarioComum.email.label', default: 'Email')}" />
                        
                            <g:sortableColumn property="telefone" title="${message(code: 'usuarioComum.telefone.label', default: 'Telefone')}" />                 
                            
                            <g:sortableColumn property="projeto" title="${message(code: 'usuarioComum.projeto.label', default: 'Projeto')}" />
                            
                            <g:sortableColumn property="tipo" title="${message(code: 'usuarioComum.tipo.label', default: 'Tipo')}" />
                            
                            <g:sortableColumn property="anoIngresso" title="${message(code: 'usuarioComum.anoIngresso.label', default: 'Ano de Ingressao')}" />
                            
                            <g:sortableColumn property="projeto" title="${message(code: 'usuarioComum.id.label', default: 'Detalhes')}" />
                                                       
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${usuarioComumInstanceList}" status="i" var="usuarioComumInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td>${fieldValue(bean: usuarioComumInstance, field: "userRealName")}</td>
                            
                            <td>${fieldValue(bean: usuarioComumInstance, field: "username")}</td>
                                             
                            <td>${fieldValue(bean: usuarioComumInstance, field: "email")}</td>
                       
                            <g:if test="${Contas.Telefone.get(usuarioComumInstance.telefoneId) != null}">
                            	<td>${Contas.Telefone.get(usuarioComumInstance.telefoneId).formatFone()}</td>
                            </g:if>
                        	<g:else>
 		                       	<td>${}</td>
                        	</g:else>
                            
                        	<td>${fieldValue(bean: usuarioComumInstance, field: "projeto")}</td>
                        	
                        	<td>${fieldValue(bean: usuarioComumInstance, field: "tipo")}</td>
                        	
                        	<td>${fieldValue(bean: usuarioComumInstance, field: "anoIngresso")}</td>
                        	
                        	<td class = "actionButtons"><span class = "actionButton"><g:link action="show" id="${usuarioComumInstance.id}">
                              Ver mais
                            </g:link></span></td>
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${usuarioComumInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
